Skip to content

docs: rewrite documentation against the code, add diagrams and Cmd+B - #40

Merged
Kameleon21 merged 2 commits into
Masterfrom
feat/docs-overhaul
Sep 13, 2026
Merged

Kameleon21 merged 2 commits into
Masterfrom
feat/docs-overhaul

Conversation

@Kameleon21

@Kameleon21 Kameleon21 commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

The audit found the docs described an app that was never built (invented profiles API, roles "synced from Clerk", middleware protecting /admin, magic links, a project-structure page that didn't exist). This PR rewrites every page against the source at 702d051, adds 12 Mermaid diagrams, and adds a Cmd+B sidebar toggle.

Content (all 18 pages rewritten, 2 new)

  • Every function name, field, index, route, limit and env var name verified against convex/ and src/.
  • New: api-reference/email-subscriptions, technical/project-structure.
  • Fixed: profiles API (getUserProfile, updateUserName, deleteAccount, users.currentUser, users.ensureProfile), schema (6 tables, all indexes), auth (roles only in profiles.role, no /admin, proxy.ts protects nothing, password + email code + OAuth), data flow (listApprovedJobs, postJob, 14/30-day lifecycle with batched cron), bookmarks ({ bookmarked, tracked }, full transition table), deployment (single ci.yml, skipped Vercel job, env var names per deployment), contributing (bunx tsc --noEmit, real checklist).
  • User guide describes the real UI: sign-up with verification code, single-phrase search, bookmark un-toggle rule, statuses and reversibility, 6/hour 20/day limits, confirm-click unsubscribe. Honest about limits (no pagination, no editing submissions).

Diagrams

<Mermaid> client component (src/components/docs/Mermaid.tsx): lazy-loads mermaid@12 on docs pages only, securityLevel: strict, light/dark palettes following data-theme, role="img" + caption, collapsible "Diagram source". Verified in headless Chrome: 12/12 diagrams render, 0 failures.

Interactivity

  • Sidebar collapse slides like a dock. Fumadocs' default collapse morphs the sidebar into a floating rounded panel; this PR overrides it so the panel translates off-screen on one easing curve while the content grid follows (src/app/docs/globals.css). Hovering the left edge peeks it back in. prefers-reduced-motion disables the transition.
  • Every diagram is expandable. An "Expand" control (visible on hover/focus) opens the SVG in a native <dialog> at up to 96vw; Esc, backdrop click or the close button dismiss it. The system diagram is also laid out top-down so it fills the content column instead of a thin strip.
  • Cmd+B / Ctrl+B toggles the sidebar: collapses the column ≥768px, opens/closes the drawer below. Ignored in inputs/textareas/contenteditable. ⌘B hint in the docs toolbar (shows Ctrl on non-Mac). Cmd+K search already existed; both documented on the index page.
  • Steps/Step/Tabs/Tab registered as MDX components (the user guide uses Steps).

Also

  • One-line comment fix in convex/bookmarks.ts (removal is not confirm-gated).
  • overrides.lodash-es: ^4.18.1 in package.json: mermaid → dagre-d3-es allows ^4.17.21 but the resolver kept 4.17.23 (GHSA-r5fr-rjxr-66jc, high). The security audit job caught it.

Verification

  • bun run lint, bunx tsc --noEmit clean
  • bun run test:ci 104/104 (8 new), coverage 39% statements
  • bun run audit:deps clean
  • bun run build green, 28 static pages
  • Every meta.json entry has a file, every /docs/... link resolves, no duplicate H1s
  • Headless Chrome: all 12 diagrams render as SVG

Follow-ups noted by the writers (not in this PR)

  • admin.deleteJob doesn't delete jobNotificationDeliveries rows (the cron path does)
  • tests/README.md and convex/README.md are stale (npm, Supabase-era layout)
  • Full CSP still deferred

Content
- Every page rewritten and verified against convex/ and src/: real
  function names (listApprovedJobs, postJob, getUserProfile,
  updateUserName, deleteAccount, updateBookmarkStatus, ...), all six
  tables and indexes, roles in profiles.role (not Clerk metadata), no
  /admin route or middleware protection, password + email code + OAuth
  (no magic link), exact submission limits and rate limits, 14/30-day
  job lifecycle with the batched cron, bookmark/tracking rules, stable
  unsubscribe tokens
- New pages: api-reference/email-subscriptions, technical/project-structure
  (was a broken sidebar link)
- Deployment and contributing pages reflect the single ci.yml, deploy.yml,
  the skipped Vercel job, env var names per deployment, `bunx tsc --noEmit`
  instead of the never-exiting `bun run type-check`
- Removed duplicate H1s; frontmatter title/description render the heading

Diagrams
- Mermaid client component (theme-aware, lazy-loaded, strict security,
  accessible label, collapsible source) registered for MDX
- 12 diagrams: system overview, request/subscription sequence, job
  lifecycle, approval fan-out, sign-in sequence, authorization map,
  application status machine (x2), schema ER, deploy pipeline,
  posting flow, notification flow

Interactivity
- Cmd+B / Ctrl+B toggles the sidebar (collapse on desktop, drawer on
  mobile), ignored while typing; kbd hint in the docs toolbar
- Steps/Step and Tabs/Tab registered as MDX components

Tests: 7 new unit tests for the shortcut and Mermaid components.
@vercel

vercel Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
firstdevjob Ready Ready Preview Sep 13, 2026 9:24am UTC

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

…diagram

- Sidebar collapse (Cmd+B / collapse button) now slides in and out like a
  dock on one easing curve, with the content grid following; Fumadocs'
  default morph into a floating panel is overridden. Honours
  prefers-reduced-motion.
- Every diagram gets an "Expand" control that opens it in a native <dialog>
  at up to 96vw, closable by Esc, backdrop click or the close button.
- System diagram switched from left-to-right to top-down so it fills the
  content column instead of rendering as a thin strip.
- Override lodash-es to ^4.18.1: mermaid's dagre-d3-es allows the range but
  the resolver kept 4.17.23, which carries GHSA-r5fr-rjxr-66jc (high).
@Kameleon21
Kameleon21 merged commit 3faa2f7 into Master Sep 13, 2026
6 checks passed
@Kameleon21
Kameleon21 deleted the feat/docs-overhaul branch September 13, 2026 09:27

This branch was successfully deployed

1 active deployment
Preview — 82b61728 Deployed Sep 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant